import 'package:json_annotation/json_annotation.dart';

part 'inventory.g.dart';

@JsonSerializable()
class InventoryModel {
  /// 标题
  String title;

  /// 部门
  String deptName;

  /// 负责人
  String charge;

  /// 计划时间
  String startPlan;

  String endPlan;

  /// 进度
  int schedule;

  InventoryModel(
      {required this.title,
      required this.deptName,
      required this.charge,
      required this.startPlan,
      required this.endPlan,
      required this.schedule});

  factory InventoryModel.fromJson(Map<String, dynamic> json) => _$InventoryModelFromJson(json);

  Map<String, dynamic> toJson() => _$InventoryModelToJson(this);

  @override
  String toString() {
    return toJson().toString();
  }
}

@JsonSerializable()
class InventoryTaskModel {
  /// 图片地址
  String imgUrl;

  /// 名称
  String name;

  /// 编号
  String code;

  /// 位置
  String location;

  InventoryTaskModel(
      {required this.imgUrl, required this.name, required this.code, required this.location});

  factory InventoryTaskModel.fromJson(Map<String, dynamic> json) =>
      _$InventoryTaskModelFromJson(json);

  Map<String, dynamic> toJson() => _$InventoryTaskModelToJson(this);

  @override
  String toString() {
    return toJson().toString();
  }
}
